+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
+Tue Jun 9 18:44:57 1998 Owen Taylor <otaylor@gtk.org>
+
+ * gtk/gtkobject.c: Removed g_object_pointer_hash, which
+ was just g_direct_hash.
+
+Mon May 25 19:54:20 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in: x_libs=, not $x_libs=. Enough said.
+ (Case only hit for --disable-xshm)
+
+Mon May 25 12:08:14 1998 Owen Taylor <otaylor@gtk.org>
+
+ * configure.in (LDFLAGS): Add to $CFLAGS and $LDFLAGS
+ when testing for X libraries, don't replace them. Because
+ the user might have specified the path to the X libraries
+ themself before running configure.
+
+ * examples/**.c: Changed all gpointer * to gpointer
+
1998-06-09 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtkhandlebox.h (struct _GtkHandleBox): Removed the
Sat May 23 21:54:05 1998 Owen Taylor <otaylor@gtk.org>
- * configure.in (LDFLAGS): Bombo out with a moderately
+ * configure.in (LDFLAGS): Bomb out with a moderately
helpful message if detection of X libraries fails.
Sat May 23 18:57:06 1998 Owen Taylor <otaylor@gtk.org>
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
-CFLAGS="$X_CFLAGS"
-LDFLAGS="$X_LDFLAGS $X_LIBS"
+CFLAGS="$CFLAGS $X_CFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
if test "x$no_x" = "xyes"; then
AC_MSG_ERROR([
AC_CHECK_LIB(Xext, XShapeCombineMask,
if test -z "`echo $x_libs | grep "\-lXext" 2> /dev/null`"; then
- $x_libs="-lXext $x_libs"
+ x_libs="-lXext $x_libs"
fi
AC_DEFINE(HAVE_SHAPE_EXT),
,
}
/* our usual callback function */
-void callback (GtkWidget *widget, gpointer *data)
+void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs)));
}
-void destroy (GtkWidget *widget, gpointer *data)
+void destroy (GtkWidget *widget, gpointer data)
{
gtk_main_quit ();
}
/* Our new improved callback. The data passed to this function is printed
* to stdout. */
-void callback (GtkWidget *widget, gpointer *data)
+void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
/* another callback */
-void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
+void delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}
gtk_widget_draw(GTK_WIDGET(notebook), NULL);
}
-void delete (GtkWidget *widget, GdkEvent *event, gpointer *data)
+void delete (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}
#include "gtk/gtk.h"
void
-delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
+delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}
/* when invoked (via signal delete_event), terminates the application.
*/
-void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
+void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
+{
gtk_main_quit();
}
/* is invoked when the button is clicked. It just prints a message.
*/
-void button_clicked( GtkWidget *widget, gpointer *data ) {
+void button_clicked( GtkWidget *widget, gpointer data ) {
printf( "button clicked\n" );
}
pstat = FALSE;
}
-void destroy (GtkWidget *widget, GdkEvent *event, gpointer *data)
+void destroy (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}
#include <gtk/gtk.h>
#include <glib.h>
-void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
+void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
+{
gtk_main_quit();
}
/* this routine gets control when the close button is clicked
*/
-void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
+void close_application( GtkWidget *widget, GdkEvent *event, gpointer data )
+{
gtk_main_quit();
}
#include <gtk/gtk.h>
-void destroy(GtkWidget *widget, gpointer *data)
+void destroy(GtkWidget *widget, gpointer data)
{
gtk_main_quit();
}
GtkWidget *status_bar;
-void push_item (GtkWidget *widget, gpointer *data)
+void push_item (GtkWidget *widget, gpointer data)
{
static int count = 1;
char buff[20];
return;
}
-void pop_item (GtkWidget *widget, gpointer *data)
+void pop_item (GtkWidget *widget, gpointer data)
{
gtk_statusbar_pop( GTK_STATUSBAR(status_bar), (guint) &data );
return;
/* our callback.
* the data passed to this function is printed to stdout */
-void callback (GtkWidget *widget, gpointer *data)
+void callback (GtkWidget *widget, gpointer data)
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}
/* this callback quits the program */
-void delete_event (GtkWidget *widget, GdkEvent *event, gpointer *data)
+void delete_event (GtkWidget *widget, GdkEvent *event, gpointer data)
{
gtk_main_quit ();
}
/* when invoked (via signal delete_event), terminates the application.
*/
-void close_application( GtkWidget *widget, GdkEvent *event, gpointer *data ) {
+void close_application( GtkWidget *widget, GdkEvent *event, gpointer data ) {
gtk_main_quit();
}
GdkFont* gdk_fontset_load (gchar *fontset_name);
GdkFont* gdk_font_ref (GdkFont *font);
void gdk_font_unref (GdkFont *font);
-gint gdk_font_id (GdkFont *font);
-gint gdk_font_equal (GdkFont *fonta,
- GdkFont *fontb);
+gint gdk_font_id (const GdkFont *font);
+gint gdk_font_equal (const GdkFont *fonta,
+ const GdkFont *fontb);
gint gdk_string_width (GdkFont *font,
const gchar *string);
gint gdk_text_width (GdkFont *font,
static guint
-hash_color (gpointer key)
+hash_color (g_const_pointer key)
{
- GdkColor *color = key;
+ const GdkColor *color = key;
return (color->red * 33023 + color->green * 30013 + color->blue * 27011);
}
static gint
-compare_colors (gpointer a,
- gpointer b)
+compare_colors (g_const_pointer a,
+ g_const_pointer b)
{
- GdkColor *aa = a;
- GdkColor *bb = b;
+ const GdkColor *aa = a;
+ const GdkColor *bb = b;
return ((aa->red == bb->red) && (aa->green == bb->green) && (aa->blue == bb->blue));
}
}
gint
-gdk_font_id (GdkFont *font)
+gdk_font_id (const GdkFont *font)
{
- GdkFontPrivate *font_private;
+ const GdkFontPrivate *font_private;
g_return_val_if_fail (font != NULL, 0);
- font_private = (GdkFontPrivate*) font;
+ font_private = (const GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
}
gint
-gdk_font_equal (GdkFont *fonta,
- GdkFont *fontb)
+gdk_font_equal (const GdkFont *fonta,
+ const GdkFont *fontb)
{
- GdkFontPrivate *privatea;
- GdkFontPrivate *privateb;
+ const GdkFontPrivate *privatea;
+ const GdkFontPrivate *privateb;
g_return_val_if_fail (fonta != NULL, FALSE);
g_return_val_if_fail (fontb != NULL, FALSE);
- privatea = (GdkFontPrivate*) fonta;
- privateb = (GdkFontPrivate*) fontb;
+ privatea = (const GdkFontPrivate*) fonta;
+ privateb = (const GdkFontPrivate*) fontb;
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
{
static guint
-hash_color (gpointer key)
+hash_color (g_const_pointer key)
{
- GdkColor *color = key;
+ const GdkColor *color = key;
return (color->red * 33023 + color->green * 30013 + color->blue * 27011);
}
static gint
-compare_colors (gpointer a,
- gpointer b)
+compare_colors (g_const_pointer a,
+ g_const_pointer b)
{
- GdkColor *aa = a;
- GdkColor *bb = b;
+ const GdkColor *aa = a;
+ const GdkColor *bb = b;
return ((aa->red == bb->red) && (aa->green == bb->green) && (aa->blue == bb->blue));
}
}
gint
-gdk_font_id (GdkFont *font)
+gdk_font_id (const GdkFont *font)
{
- GdkFontPrivate *font_private;
+ const GdkFontPrivate *font_private;
g_return_val_if_fail (font != NULL, 0);
- font_private = (GdkFontPrivate*) font;
+ font_private = (const GdkFontPrivate*) font;
if (font->type == GDK_FONT_FONT)
{
}
gint
-gdk_font_equal (GdkFont *fonta,
- GdkFont *fontb)
+gdk_font_equal (const GdkFont *fonta,
+ const GdkFont *fontb)
{
- GdkFontPrivate *privatea;
- GdkFontPrivate *privateb;
+ const GdkFontPrivate *privatea;
+ const GdkFontPrivate *privateb;
g_return_val_if_fail (fonta != NULL, FALSE);
g_return_val_if_fail (fontb != NULL, FALSE);
- privatea = (GdkFontPrivate*) fonta;
- privateb = (GdkFontPrivate*) fontb;
+ privatea = (const GdkFontPrivate*) fonta;
+ privateb = (const GdkFontPrivate*) fontb;
if (fonta->type == GDK_FONT_FONT && fontb->type == GDK_FONT_FONT)
{
+Tue Jun 9 17:47:33 1998 Owen Taylor <otaylor@gtk.org>
+
+ * glib.h: Remove #error - HP/UX.
+
+Sat May 23 19:00:01 1998 Owen Taylor <otaylor@gtk.org>
+ [ Combination of:
+ gtk-rrh-980412-0.patch (Raja R Harinath <harinath@cs.umn.edu>)
+ gtk-jbuhler-980516-0 (Jeremy Buhler <jbuhler@cs.washington.edu>) ]
+
+ * glib.h ghash.c gstring.c gdataset.c gutils.c:
+ - Added new typedef g_const_pointer; expunged all incorrect
+ uses of 'const gpointer'.
+ - Fixed up warnings that that created,
+ - Changed GHashFunc and GCompareFunc to take g_const_pointer
+ arguments. (Necessary, but will cause warnings in existing
+ code until fixed)
+ - Added other new const in harmless positions.
+
Mon Jun 8 01:06:47 1998 Tim Janik <timj@gtk.org>
* glib.h: added enum-helper macros for code generation.
gpointer data;
GDestroyNotify destroy_func;
};
+
struct _GDataset
{
- gpointer location;
+ g_const_pointer location;
GDatasetData *data_list;
};
/* --- prototypes --- */
-static inline GDataset* g_dataset_lookup (const gpointer dataset_location);
-static inline void g_dataset_destroy_i (GDataset *dataset);
+static inline GDataset* g_dataset_lookup (g_const_pointer dataset_location);
+static inline void g_dataset_destroy_i (GDataset *dataset);
static void g_dataset_initialize (void);
static guint* g_dataset_id_new (void);
/* --- functions --- */
static inline GDataset*
-g_dataset_lookup (const gpointer dataset_location)
+g_dataset_lookup (g_const_pointer dataset_location)
{
register GDataset *dataset;
}
void
-g_dataset_destroy (const gpointer dataset_location)
+g_dataset_destroy (g_const_pointer dataset_location)
{
register GDataset *dataset;
}
void
-g_dataset_id_set_destroy (const gpointer dataset_location,
- guint key_id,
- GDestroyNotify destroy_func)
+g_dataset_id_set_destroy (g_const_pointer dataset_location,
+ guint key_id,
+ GDestroyNotify destroy_func)
{
g_return_if_fail (dataset_location != NULL);
}
gpointer
-g_dataset_id_get_data (const gpointer dataset_location,
- guint key_id)
+g_dataset_id_get_data (g_const_pointer dataset_location,
+ guint key_id)
{
g_return_val_if_fail (dataset_location != NULL, NULL);
}
void
-g_dataset_id_set_data_full (const gpointer dataset_location,
- guint key_id,
- gpointer data,
- GDestroyNotify destroy_func)
+g_dataset_id_set_data_full (g_const_pointer dataset_location,
+ guint key_id,
+ gpointer data,
+ GDestroyNotify destroy_func)
{
register GDataset *dataset;
register GDatasetData *list;
dataset = g_chunk_new (GDataset, g_dataset_mem_chunk);
dataset->location = dataset_location;
dataset->data_list = NULL;
- g_hash_table_insert (g_dataset_location_ht, dataset->location, dataset);
+ g_hash_table_insert (g_dataset_location_ht,
+ (gpointer) dataset->location, /* Yuck */
+ dataset);
}
list = dataset->data_list;
}
void
-g_hash_table_remove (GHashTable *hash_table,
- gpointer key)
+g_hash_table_remove (GHashTable *hash_table,
+ g_const_pointer key)
{
GRealHashTable *rhash_table;
GHashNode *node;
gpointer
g_hash_table_lookup (GHashTable *hash_table,
- const gpointer key)
+ g_const_pointer key)
{
GRealHashTable *rhash_table;
GHashNode *node;
#endif /* 0 */
typedef void* gpointer;
+typedef const void *g_const_pointer;
#if (SIZEOF_CHAR == 1)
typedef signed char gint8;
#define GUINT_TO_POINTER(u) ((gpointer)(gulong)(u))
#else
-#error "No integer type of the same size as a pointer"
+/* This should never happen */
#endif
typedef void (*GHFunc) (gpointer key,
gpointer value,
gpointer user_data);
-typedef guint (*GHashFunc) (gpointer key);
-typedef gint (*GCompareFunc) (gpointer a,
- gpointer b);
typedef gpointer (*GCacheNewFunc) (gpointer key);
typedef gpointer (*GCacheDupFunc) (gpointer value);
typedef void (*GCacheDestroyFunc) (gpointer value);
gint error);
typedef void (*GDestroyNotify) (gpointer data);
+typedef guint (*GHashFunc) (g_const_pointer key);
+typedef gint (*GCompareFunc) (g_const_pointer a,
+ g_const_pointer b);
struct _GList
{
GCompareFunc key_compare_func);
void g_hash_table_destroy (GHashTable *hash_table);
void g_hash_table_insert (GHashTable *hash_table,
- gpointer key,
- gpointer value);
+ gpointer key,
+ gpointer value);
void g_hash_table_remove (GHashTable *hash_table,
- gpointer key);
+ g_const_pointer key);
gpointer g_hash_table_lookup (GHashTable *hash_table,
- const gpointer key);
+ g_const_pointer key);
void g_hash_table_freeze (GHashTable *hash_table);
void g_hash_table_thaw (GHashTable *hash_table);
void g_hash_table_foreach (GHashTable *hash_table,
/* Hash Functions
*/
-gint g_str_equal (const gpointer v,
- const gpointer v2);
-guint g_str_hash (const gpointer v);
+gint g_str_equal (g_const_pointer v,
+ g_const_pointer v2);
+guint g_str_hash (g_const_pointer v);
/* This "hash" function will just return the key's adress as an
* unsigned integer. Useful for hashing on plain adresses or
* simple integer values.
*/
-guint g_direct_hash (gpointer key);
+guint g_direct_hash (g_const_pointer key);
/* Location Associated Data
*/
-void g_dataset_destroy (const gpointer dataset_location);
+void g_dataset_destroy (g_const_pointer dataset_location);
guint g_dataset_try_key (const gchar *key);
guint g_dataset_force_id (const gchar *key);
-gpointer g_dataset_id_get_data (const gpointer dataset_location,
+gpointer g_dataset_id_get_data (g_const_pointer dataset_location,
guint key_id);
-void g_dataset_id_set_data_full (const gpointer dataset_location,
+void g_dataset_id_set_data_full (g_const_pointer dataset_location,
guint key_id,
gpointer data,
GDestroyNotify destroy_func);
-void g_dataset_id_set_destroy (const gpointer dataset_location,
+void g_dataset_id_set_destroy (g_const_pointer dataset_location,
guint key_id,
GDestroyNotify destroy_func);
register gpointer *d;
d = user_data;
- func = d[0];
+ func = (GHFunc)d[0];
func_data = d[1];
hash_val = value;
g_return_if_fail (scanner != NULL);
- d[0] = func;
+ d[0] = (gpointer)func;
d[1] = func_data;
g_hash_table_foreach (scanner->symbol_table, g_scanner_foreach_internal, d);
*/
gint
-g_str_equal (const gpointer v, const gpointer v2)
+g_str_equal (g_const_pointer v, g_const_pointer v2)
{
- return strcmp ((gchar*) v, (gchar*)v2) == 0;
+ return strcmp ((const gchar*) v, (const gchar*)v2) == 0;
}
/* a char* hash function from ASU */
guint
-g_str_hash (const gpointer v)
+g_str_hash (g_const_pointer v)
{
- char *s = (char*)v;
- char *p;
+ const char *s = (char*)v;
+ const char *p;
guint h=0, g;
for(p = s; *p != '\0'; p += 1) {
}
guint
-g_direct_hash(gpointer key)
+g_direct_hash(g_const_pointer key)
{
return GPOINTER_TO_UINT (key);
}
}
guint
-my_hash (gpointer key)
+my_hash (g_const_pointer key)
{
- return (guint) *((gint*) key);
+ return (guint) *((const gint*) key);
}
gint
-my_hash_compare (gpointer a,
- gpointer b)
+my_hash_compare (g_const_pointer a,
+ g_const_pointer b)
{
- return *((gint*) a) == *((gint*) b);
+ return *((const gint*) a) == *((const gint*) b);
}
gint
-my_list_compare_one (gpointer a, gpointer b)
+my_list_compare_one (g_const_pointer a, g_const_pointer b)
{
- gint one = *((gint*)a);
- gint two = *((gint*)b);
+ gint one = *((const gint*)a);
+ gint two = *((const gint*)b);
return one-two;
}
gint
-my_list_compare_two (gpointer a, gpointer b)
+my_list_compare_two (g_const_pointer a, g_const_pointer b)
{
- gint one = *((gint*)a);
- gint two = *((gint*)b);
+ gint one = *((const gint*)a);
+ gint two = *((const gint*)b);
return two-one;
}
}; */
gint
-my_compare (gpointer a,
- gpointer b)
+my_compare (g_const_pointer a,
+ g_const_pointer b)
{
- char *cha = a;
- char *chb = b;
+ const char *cha = a;
+ const char *chb = b;
return *cha - *chb;
}
/* --- functions --- */
static gint
-gtk_accel_entries_equal (gpointer a,
- gpointer b)
+gtk_accel_entries_equal (g_const_pointer a,
+ g_const_pointer b)
{
- GtkAccelEntry *e1;
- GtkAccelEntry *e2;
+ const GtkAccelEntry *e1;
+ const GtkAccelEntry *e2;
e1 = a;
e2 = b;
}
static guint
-gtk_accel_entries_hash (gpointer a)
+gtk_accel_entries_hash (g_const_pointer a)
{
- GtkAccelEntry *e;
+ const GtkAccelEntry *e;
guint h;
e = a;
GList *li;
/* completion */
- if ( event->keyval == GDK_Tab ) {
+ if (event->keyval == GDK_Tab)
+ {
GCompletion * cmpl;
gchar* prefix;
gchar* nprefix = NULL;
- guint pos;
+ gint pos;
gtk_signal_emit_stop_by_name (GTK_OBJECT (entry), "key_press_event");
cmpl = g_completion_new((GCompletionFunc)gtk_combo_func);
pos = GTK_EDITABLE(entry)->current_pos;
prefix = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, pos);
g_completion_complete(cmpl, prefix, &nprefix);
- if ( nprefix && strlen(nprefix) > strlen(prefix) ) {
+ if (nprefix && strlen(nprefix) > strlen(prefix))
+ {
gtk_editable_insert_text(GTK_EDITABLE(entry), nprefix+pos,
- strlen(nprefix)-strlen(prefix), &pos);
+ strlen(nprefix)-strlen(prefix), &pos);
GTK_EDITABLE(entry)->current_pos = pos;
}
g_free(prefix);
guint tag,
gint remove_link);
-static gint gtk_idle_compare (gpointer a,
- gpointer b);
+static gint gtk_idle_compare (g_const_pointer a,
+ g_const_pointer b);
-static gint gtk_timeout_compare (gpointer a,
- gpointer b);
+static gint gtk_timeout_compare (g_const_pointer a,
+ g_const_pointer b);
const guint gtk_major_version = GTK_MAJOR_VERSION;
const guint gtk_minor_version = GTK_MINOR_VERSION;
* sure that we insert at the _end_ of the idles of this priority
*/
static gint
-gtk_idle_compare (gpointer a, gpointer b)
+gtk_idle_compare (g_const_pointer a, g_const_pointer b)
{
- return (((GtkIdleFunction *)a)->priority < ((GtkIdleFunction *)b)->priority)
+ return (((const GtkIdleFunction *)a)->priority <
+ ((const GtkIdleFunction *)b)->priority)
? -1 : 1;
}
* sure that we insert after timeouts of equal interval
*/
static gint
-gtk_timeout_compare (gpointer a, gpointer b)
+gtk_timeout_compare (g_const_pointer a, g_const_pointer b)
{
- return (((GtkTimeoutFunction *)a)->interval <
- ((GtkTimeoutFunction *)b)->interval)
+ return (((const GtkTimeoutFunction *)a)->interval <
+ ((const GtkTimeoutFunction *)b)->interval)
? -1 : 1;
}
g_print ("GTK-DEBUG: living objects count = %d\n", obj_count);
}
-static guint
-gtk_object_pointer_hash (const gpointer v)
-{
- gint i;
-
- i = (gint) v;
-
- return i;
-}
#endif /* G_ENABLE_DEBUG */
/****************************************************
obj_count++;
if (!living_objs_ht)
- living_objs_ht = g_hash_table_new (gtk_object_pointer_hash, NULL);
+ living_objs_ht = g_hash_table_new (g_direct_hash, NULL);
g_hash_table_insert (living_objs_ht, object, object);
}
};
-static guint gtk_signal_hash (const gpointer h);
-static gint gtk_signal_compare (const gpointer h1,
- const gpointer h2);
+static guint gtk_signal_hash (g_const_pointer h);
+static gint gtk_signal_compare (g_const_pointer h1,
+ g_const_pointer h2);
static GtkHandler* gtk_signal_handler_new (void);
static void gtk_signal_handler_ref (GtkHandler *handler);
static void gtk_signal_handler_unref (GtkHandler *handler,
}
static guint
-gtk_signal_hash (const gpointer h)
+gtk_signal_hash (g_const_pointer h)
{
- register GtkSignalHash *hash = h;
+ register const GtkSignalHash *hash = h;
return hash->object_type ^ hash->name_key_id;
}
static gint
-gtk_signal_compare (const gpointer h1,
- const gpointer h2)
+gtk_signal_compare (g_const_pointer h1,
+ g_const_pointer h2)
{
- register GtkSignalHash *hash1 = h1;
- register GtkSignalHash *hash2 = h2;
+ register const GtkSignalHash *hash1 = h1;
+ register const GtkSignalHash *hash2 = h2;
return (hash1->name_key_id == hash2->name_key_id &&
hash1->object_type == hash2->object_type);
}
static guint
-font_hash (gpointer font)
+font_hash (g_const_pointer font)
{
- return gdk_font_id ((GdkFont*) font);
+ return gdk_font_id ((const GdkFont*) font);
}
static TextFont*